package com.dehui.traders.kchart;

import android.graphics.Matrix;

import com.github.mikephil.charting.utils.ViewPortHandler;

/**
 * Created by hqq on 18.4.20.
 */

public class KBaseManager{

    protected void setHandler(MyCombinedChart combinedChart,DataParse mData) {
        final ViewPortHandler viewPortHandlerBar = combinedChart.getViewPortHandler();
        viewPortHandlerBar.setMaximumScaleX(culcMaxscale(mData.getXVals().size()));
        Matrix touchmatrix = viewPortHandlerBar.getMatrixTouch();
        final float xscale = 3;
        touchmatrix.postScale(xscale, 1f);
    }

    private float culcMaxscale(float count) {
        float max = 1;
        max = count / 127 * 5;
        return max;
    }
}
